int commonFactors(int a, int b) {
	int m = (a > b ? b : a);
	int cnt = 0;
	while (m >= 1) {
		if (a % m == 0 && b % m == 0) {
			cnt++;
		}
		m--;
	}
	return cnt;
}